module.exports = {
  async fetch({ page, args }) {
    if ((args.keyword != '') & (args.keyword != undefined)) {
      url = `http://api.skyrj.com:80/Api2/Dy/GetPageList?SearchKey=${encodeURI(args.keyword)}&pageSize=10&pageIndex=1`
    } else {
      url = `http://api.skyrj.com:80/Api2/Dy/GetPageList?pageSize=10&pageIndex=${page||2}&type=${args.sort}&Channel=&Area=&Plot=&Year=&orderBy=new`
    }
    console.log('感谢@lyydhy')
    let resp = await $http.get(url)
    let list =resp.data
    let items = list.map(data=> {
      return{
        link: url,
        id:data.ID,
        style: 'vod',
        thumb: data.Cover,
        title: data.Name,
        label:data.Tags,
        summary:'更新:'+data.UpdateTime,
        route: $route('other/detail', {
          id: data.ID
        })
      }
      
      
      
      
    })
    return {
      nextPage: (page || 2) + 1,
      items: items
    }
  }
}
